<?php

namespace App\Http\Resources;

use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;

class ChapterResource extends JsonResource
{
    public function toArray(Request $request): array
    {
        return [
            'chapter_id' => $this->id,
            'title' => $this->title,
            'start_at' => (string) $this->start_at,
            'end_at' => (string) $this->end_at,
            'now_time' => time(),
        ];
    }
}
